//package com.monitor.app_monitor.service.impl;
//
//import com.monitoring.exportercollect.model.Config.AppInfo;
//import com.monitoring.exportercollect.model.Config.ScriptExecResult;
//import com.monitoring.exportercollect.service.MonitorService;
//import com.monitoring.exportercollect.service.quartz.utils.ExecuteScript;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.util.Arrays;
//import java.util.List;
//
//
//@Service("mysqlMonitor")
//@Slf4j
//public class mysqlMonitor implements MonitorService {
//
//
//    @Resource
//    private ExecuteScript executeScript;
//
//    @Override
//    public int receiveCode(AppInfo appInfo) {
//
//        final ScriptExecResult scriptExecResult;
//        String  scriptResult = null;
//        try {
//            final String[] split = appInfo.getMonitorParameter().split("-");
//
//            List parameter = Arrays.asList(split);
//
//            scriptExecResult = executeScript.executeScript("/root/bin/mysql_monitor.sh",parameter);
//            scriptResult = scriptExecResult.getStatus();
//            log.info("scriptExecResult is :" + scriptResult);
//            return Integer.valueOf(scriptResult);
//        } catch (Exception e) {
//            log.info("scriptExecResult is :" + scriptResult);
//            return 0;
//        }
//    }
//
//
//}
